{extends file="./main.tpl"}
{block name=head}
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type="text/css" title="currentStyle">
  @import "media2/css/demo_page.css";
	@import "media2/css/demo_table.css";
	@import "media2/css/themes/base/jquery-ui.css";
	@import "media2/css/themes/smoothness/jquery-ui-1.7.2.custom.css";
	
</style>
<script src="media2/js/jquery-1.4.4.min.js" type="text/javascript"></script>
<script src="media2/js/jquery.dataTables.min.js" type="text/javascript"></script>
<script src="media2/js/jquery-ui.js" type="text/javascript"></script>
<script src="media2/js/jquery.dataTables.columnFilter.js" type="text/javascript"></script>
<script src="./js/loandetail.js" type="text/javascript"></script>

{/block}
{block name=body}
  <body id="dt_example"> 
    <center><font size="5px" align="center">Loan Detail</font></center>
    <form name="dateForm" action="{$smarty.server.PHP_SELF}" method="post"> 
      <table align="center">
        <tr>
          <td valign="bottom">{html_select_date prefix='toDate' field_order="DmY" month_format="%m" start_year='-5' end_year='+5' time=$today}</td>
          <td><input type="submit" name="dateSubmit" id="go" value="Go"></td>
        </tr>
      </table>
    </form>
	    <div id="demo">  
        <form name="frm" method="post" action="loanDetail.php">
          <table cellpadding="2" border="1" cellspacing="0" id="example" class="display">  
            <thead>
              <tr style="background-color:#F6AF3A; height:18px; font-size:11px;">
                <th> Detail </th>
                <th> Loan No </th>
                <th> Party Name </th>
                <th> Mobile </th>
                <th> Monthly Interest </th>
                <th> Date Of Last Installment </th>
                <th> Pending Interest </th>
                <th> Pending Instrast In Rs </th>
                <th> Receive Installment </th>
                <th> Note </th>
              </tr>
              <tr>
                <th>  </th>
                <th> Loan No </th>
                <th> Party Name </th>
                <th> Mobile </th>
                <th> Monthly Interest </th>
                <th> Date Of Last Installment </th>
                <th> Pending Interest </th>
                <th> Pending Instrast In Rs </th>
                <th></th>
                <th></th>
              </tr>
            </thead>
            <tbody>
              {section name=display loop=$displayArray}
              <tr align="center" style="font-size:13px;">
                <td><a href="loanEdit.php?loanDetailId={$displayArray[display].loanId}" >Detail</a></td>
                <td>{$displayArray[display].loanId}</td>
                <td align="left"><a href="loanDetail.php?partyId={$displayArray[display].partyId}">{$displayArray[display].partyName}</a></td>
                <td align="left">{$displayArray[display].mobile}</td>
                <td align="right">{$displayArray[display].interest}</td>
                <td>{$displayArray[display].dateOfInstallment|date_format:"%e-%m-%Y"}</td>
                <td>{$displayArray[display].pendingInstallment}</td>
                <td align="right">{$displayArray[display].inRs}</td>
                <td align="left" nowrap >
                  <input type="checkbox" size="10" name="receivedCheck" id="{$displayArray[display].interestReceivedId}" 
                    value="{$displayArray[display].interest}" onclick="setInstallReciived(this);">
                  <input type="text" size="1" name="installmentReceived[{$displayArray[display].interestReceivedId}]" 
                    id="installmentReceived{$displayArray[display].interestReceivedId}" onkeyup="setLoanDetailRow(this,{$displayArray[display].interest});"  value="0" >
                  <input type="text" size="5" readonly name="amountReceived{$displayArray[display].interestReceivedId}" 
                    id="amountReceived{$displayArray[display].interestReceivedId}">
                </td>
                <td>
                	<textarea cols="8" name="note"></textarea>
                </td>
              </tr>
              {/section}
            </tbody>
          </table>
          <table align="center">
            <tr>
              <td colspan="5" align=""><input type="submit" name="receivedInstallment" value="Submit"></td>
            </tr>
          </table>
        </form>
      </div>
  </body>
{/block}